const fp = require('lodash/fp')
const { Maybe, Container } = require('./support')

let safeProp = fp.curry(function (x, o) {
	return Maybe.of(o[x])
})
let user = { id: 2, name: 'Albert'}

// 1.实现 ex3
let ex3 = () => safeProp('name', user).map(x => fp.first(x.split('')))
// 2.测试打印
console.log( ex3() ) // Maybe { _value: 'A' }